//
//  CanView.m
//  LiangPinZS
//
//  Created by hwd on 17/2/22.
//  Copyright © 2017年 hwd. All rights reserved.
//

#import "CanView.h"

@implementation CanView

- (instancetype)initWithFrame:(CGRect)frame backGroundColor:(NSString *)color Alpha:(NSInteger)alpha
{
    if (self = [super initWithFrame:frame]) {
        self.frame = frame;
        self.userInteractionEnabled = YES;
        self.backgroundColor = [UIColor colorWithHexString:color];
        self.alpha = alpha;
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(LabTap)];
        [self addGestureRecognizer:tap];
    }
    return self;
}

- (void)LabTap
{
    if (_block) {
        _block(self);
    }
}

@end
